package com.oamicnet.servicetwo.server.mq;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderMessageProducer {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    private static final String TOPIC = "order-topic";

    public void sendOrderMessage(OrderMessage message) {
        rocketMQTemplate.convertAndSend(TOPIC, message);
    }
}
